﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AspNetCs.Common;
public partial class VerifyCode : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        //VryImgGen gen = new VryImgGen();
        //string verifyCode = gen.CreateVerifyCode(5, 0);
        //Session["VerifyCode"] = verifyCode.ToUpper();
        //System.Drawing.Bitmap bitmap = gen.CreateImage(verifyCode);
        //System.IO.MemoryStream ms = new System.IO.MemoryStream();
        //bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
        //Response.Clear();
        //Response.ContentType = "image/Png";
        //Response.BinaryWrite(ms.GetBuffer());
        //bitmap.Dispose();
        //ms.Dispose();
        //ms.Close();
        //Response.End();


        Response.Buffer = true;
        Response.BufferOutput = false;
        Response.ExpiresAbsolute = System.DateTime.Now.AddSeconds(-1);
        Response.Expires = 0;
        Response.CacheControl = "no-cache";
        Response.Clear();
        //Asp.net 生成验证码方法一
        //CreateImage.DrawImage();

        //Asp.net 生成验证码方法二
        ValidateNumber imgto = new ValidateNumber();
        imgto.CreateValidateGraphic(this, imgto.CreateValidateNumber(6));
   
    }
}
